<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
   div {
     width: 200px;
     height: 200px;
     background-color: pink;
     position: absolute;
     top: 0;
     bottom: 0;
     right: 0;
     left: 0;
     margin: auto auto;
     /* transform: scale(0.8); */
     /* transform: scale(1, 0.8); */
     /* transform-origin: left top; */

     /* transform: rotate(45deg) */
     /* 视距 */
     perspective: 500px;
   }
   img {
     transition: transform 4s;
     /* 不是正面隐藏 */
     backface-visibility: hidden;
   }
   div:hover img {
    transform: rotateX(-180deg)
    /* transform: rotateY(180deg) */

   }
   p {
     width: 200px;
     height: 200px;
     background-color: black;
     transform: rotate(-45deg)
   }

  </style>
</head>
<body>
  <div>
    <img src="./images/2.jpg" alt="">
  </div>
  <p></p>
</body>
</html>
